﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Brjnk.Maps.Downloader
{
   public class DownloadTaskPriorities : IPriorities
    {
       public DownloadTaskPriorities()
       {
           if (Enum.GetValues(typeof(DownloadTaskPriority)).Length != 2)
               throw new Exception("Enum DownloadTaskPriority has been changed.");
       }

        public int PrioritiesCount
        {
            get { return 2; }
        }

        public int GetPriorityNumber(object item)
        {            
            if (!(item is DownloadTaskWithUpdater)) throw new ArgumentException("Argument must be DownloadTask. Argument is: "+ item.GetType().ToString());
            var task = (DownloadTaskWithUpdater)item;
            return (int)task.Task.Priority;
        }
    }


   public enum DownloadTaskPriority
   {
       //Při změně je třeba upravit třídu DownloadTaskPriorities
       High,
       Normal
   }
}
